# -*- coding: utf-8 -*-

from odoo import models, fields, api


class wliotDeviceIndicatorVal(models.Model):
    _name = 'wliot.device.indicator.value'

    device = fields.Many2one('wliot.device', string=u'设备')
    gas_present_value = fields.Float(string=u'气体当前值', digits=(16, 2))
    gas_day_avg_value = fields.Float(string=u'气体日平均值', digits=(16, 2))
    gas_calibrate_value = fields.Float(string=u'气体校准值', digits=(16, 2))
    gas_alarm_value = fields.Float(string=u'气体预警值', digits=(16, 2))
    temp_present_value = fields.Float(string=u'温度当前值', digits=(16, 2))
    temp_calibrate_value = fields.Float(string=u'温度校准值', digits=(16, 2))
    temp_alarm_value = fields.Float(string=u'温度预警值', digits=(16, 2))
    frequence = fields.Integer(string=u'采集频率')
    open_degree = fields.Integer(string=u'开合度')
    running_status = fields.Selection([
        ('normal', u'正常'),
        ('lostin', u'异常')
    ], string=u'运行状态')
    open_degree_per20 = fields.Integer(string=u'20%开合度')
    open_degree_per40 = fields.Integer(string=u'40%开合度')
    open_degree_per60 = fields.Integer(string=u'60%开合度')
    open_degree_per80 = fields.Integer(string=u'80%开合度')
    open_degree_per100 = fields.Integer(string=u'100%开合度')
    update_time = fields.Datetime(string=u'更新时间')
